/*
 * Alexey Danchuk
 * This software is an implementation of the task from OOP module.
 */
package knowledgetestsystem;

/**
 * This class describes basics issues about our presentation of question.
 * 
 * @version 2.03 10 February 2013
 * @author Alexey Danchuk
 * 
 */

abstract class Question {
	/**
	 * This variable holds question text.
	 */
	private String question;

	/**
	 * This variable holds answers array.
	 */
	private String[] variantsAnswers;

	protected Question(final String inQuestion, 
					   final String[] inVariantsAnswers) {
		inputQuestion(inQuestion);
		inputAnswers(inVariantsAnswers);
	}

	/**
	 * Method to check answers with special algorithm which is 
	 * different for our questions type.
	 * 
	 * @param userAnswers - inputed answers from user
	 * @return - plus one point to the overall user mark
	 */
	protected abstract int chekAnswer(String[] userAnswers);

	protected abstract void saveAnswer(final String[] answers);

	public final String[] getAnswerChoices() {
		return variantsAnswers;
	}

	public final String outQuestionText() {
		return question;
	}

	private final void inputQuestion(final String questionText) {
		question = questionText;
	}

	private final void inputAnswers(final String[] answersText) {
		variantsAnswers = answersText;
	}
}
